<template>
	<!-- personnellist 人员列表 -->
	<view class="r_list">
		<view class="r_item" v-for="(item,index) in list" :key="item.uid">
			<image :src="item.avatar" mode=""></image>
			<view class="r_info">
				<view class="r_tiele clamp">
					{{item.nickname}}
				</view>
				<view class="">
					电话：<text selectable>{{item.mobile}}</text>
				</view>
			</view>
			<view class="r_operation" v-if="item.status==1">
				<button size="mini" @click="$navTo('/pages/groupmenu/jurisdiction?uid='+uid+'&id='+item.mid)" type="default">权限</button>
				<!-- <button size="mini" type="default" @click="deleteTap(index)">删除</button> -->
			</view>
		</view>
		<view class="r_empty" v-if="list.length<=0">空空如也~</view>
		<bottom-tab />
	</view>
</template>

<script>
	import BottomTab from '@/components/bottomtab.vue';
	export default {
		components: {
			BottomTab
		},
		data() {
			return {
				uid: '',
				isback: '',

				list: [],
			}
		},
		onLoad(option) {
			this.isback = option.isback;
			this.uid = option.uid;
			this.getList();
		},
		methods: {
			getList() {
				this.$axios('groupManager/supManList', 'POST', 'supplier', {
					uid: this.uid
				}).then(res => {
					if (res.data.code == 200) {
						this.list = res.data.data;
					}
				})
			}
		},
		onBackPress(e) {
			if (e.from == "backbutton" && this.isback) {
				this.$navBack(2);
				return true;
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #f2f2f2;
		padding-bottom: 130upx;
	}

	.r_item {
		background-color: #fff;
		display: flex;
		align-items: center;
		padding: 20upx;
		margin-top: 20upx;
	}

	.r_item image {
		border-radius: 10upx;
		height: 100upx;
		width: 100upx;
	}

	.r_info {
		padding: 0 20upx;
		flex: 1;
		line-height: 50upx;
	}

	.r_operation button {
		display: block;
		margin-bottom: 10upx;
	}

	.r_empty {
		color: $font-color-spec;
		text-align: center;
		margin: 40upx;
	}
</style>
